#include "CGraphics.h"

void InitCGraphics(int modus) {
	system("cls");
	InitGraphics();
	SetWindowSize(90,45);
	DrawProcessBox();
	DrawInputBox();
	StartPrintMsg(); SetColor(FYI); printf("Ketik \"Help #\" untuk bantuan");
	DrawJudul(modus);
}

void DrawProcessBox() {
	DrawBox(0,5,90,31,FWI);
	SetPointerPos(3,5); 	printf("[ PROCESS BOX ]");
	FillChar2(' ', 1, PROCESSY, 89, PROCESSYMAX); 
}
void DrawInputBox() {
	DrawBox(0,40,90,4,FCI);
	SetPointerPos(3,40); 	printf("[ INPUT BOX   ]");
	FillChar2(' ', 1, INPUTY, 89, 42); 
}
void DrawMessageBox(){
	DrawBox(0,36,90,4,FRI);
	SetPointerPos(3,36); 	printf("[ MESSAGE BOX ]");
	FillChar2(' ', 1, MSGY, 89, 38); 
}

void StartPrintProcess() {
	DrawProcessBox();
	PROCESS_Y = PROCESSY;
	SetPointerPos(INDENT,PROCESS_Y);
}
void ContinuePrintProcess(){
	if(PROCESS_Y > PROCESSYMAX-1) {
		PROCESS_Y++;
		SetPointerPos(INDENT,PROCESS_Y);
		system("PAUSE");
		StartPrintProcess();
	}
	else {
		PROCESS_Y++;
		SetPointerPos(INDENT,PROCESS_Y);
	}
}

void RestartPrintProcess() {
	FillChar2(' ', 1, PROCESS_Y, 89, PROCESS_Y); 
	SetPointerPos(INDENT,PROCESS_Y);
}

void StartPrintInput() {
	DrawInputBox();
	SetPointerPos(INDENT,INPUTY);
}

void StartPrintMsg() {
	DrawMessageBox();
	SetPointerPos(INDENT,MSGY);
}

void DrawJudul(int modus) {
	DrawBox(24,1,40,3,FMI);
	if(modus==2) {
		SetPointerPos(32,2);
		printf("M O D U S  S I M U L A S I");
	} else {
		SetPointerPos(30,2);
		printf("M O D U S  P E R S I A P A N");
	}
}


